package com.hrms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hrms.domain.Employee;
import com.hrms.service.EmployeeService;
import com.hrms.mapper.EmployeeMapper;
import com.hrms.utils.ResultMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* @author 15770
* @description 针对表【t_employee】的数据库操作Service实现
* @createDate 2024-12-17 21:55:44
*/
@Service
public class EmployeeServiceImpl extends ServiceImpl<EmployeeMapper, Employee> implements EmployeeService{

    @Autowired
    private EmployeeMapper employeeMapper;

    ResultMapper resultMapper=new ResultMapper();

    @Override
    public List<Employee> selectInfos() {
        return employeeMapper.selectInfos();
    }

    @Override
    public Employee getInfo(Long empNo){
        return employeeMapper.getInfo(empNo);
    }

    @Override
    public Map add(Employee employee) {
        employeeMapper.insert(employee);
        return resultMapper.createSuccessResult();
    }

    @Override
    public Map updateEmployee(Employee employee) {
        employeeMapper.updateById(employee);
        return resultMapper.createSuccessResult();
    }

    @Override
    public Map deleteEmployeeByEmpNos(Long[] empNos){
        employeeMapper.deleteEmployeeByEmpNos(empNos);
        return resultMapper.createSuccessResult();
    }
}




